
		<h4><img src="<?php echo $html->url('/img/admin/node.png');?>" /> <?php __('reorder_tree');?></h4>

		<div class="white_box">
			<p><?php __('text_reoder_tree');?></p>
			<div id="tree-view">
				<!-- Tree-View -->
				<?php echo $this->element('admin/menu/tree_view');?> 
			</div>
		</div>
		
	<form name="f_register" id="f_register" action="<?php echo $html->url('addChild');?>" method="post" onSubmit="event.returnValue = false; return false;">

		<h4><img src="<?php echo $html->url('/img/admin/edit_register.png');?>" />  <?php __('form_tree');?></h4>

		<div class="white_box white_box_last">

			<label><?php __('name_link');?></label>
			<?php echo $form->text('Menu.name',array('style' => 'width:690px;', 'class' => 'input_text'));?>
					
			<label><input type="radio" name="link_opt" value="url" checked="checked" /> <?php __('url');?></label>
			<?php echo $form->text('Menu.url',array('onClick'=>'javascript:document.f_register.link_opt[0].checked=true;','value' =>'http://','style' => 'width:690px;', 'class' => 'input_text'));?>

			<label><input type="radio" name="link_opt" value="pages" /> <?php __('pages');?></label>
			<select name="data[Menu][pages]" id="MenuPages" onClick="javascript:document.f_register.link_opt[1].checked=true;">
				<option value="" selected="selected" style="width:600px" >-- <?php __('select_page_link');?> --</option>
				<?php foreach($paginas as $pagina){?>
				<option value="<?php echo $html->url('/pages/view/'.$pagina['Page']['title_url']);?>">
				<?php 
				//Para que no rompa el diseño
				if(strlen($pagina['Page']['title']) > 80)
					echo substr($pagina['Page']['title'],0,80)." ...";
				else
					echo $pagina['Page']['title'];
				?>
				</option>
				<?php } ?>
			</select>

			<?php if(isset($config_plugins) && is_array($config_plugins) && !empty($config_plugins)){?>
			<label><input type="radio" name="link_opt" value="plugins" /> <?php __('plugins');?></label>
			<select name="data[Menu][plugins]" id="MenuPages" onClick="javascript:document.f_register.link_opt[2].checked=true;">
				<option value="" selected="selected" style="width:600px" >-- <?php __('select_plugin_link');?> --</option>
				
				<?php foreach($config_plugins as $index => $value){?>
				<option value="<?php echo $html->url(array('controller'=>$value['controller'],'action'=>$value['action'], 'admin' => false, 'plugin' => $index));?>"><?php __($index);?></option>
				<?php }?>

			</select>
			<?php } ?>

			<!-- ID del menu al que pertenece -->
			<?php echo $form->hidden('Menu.parent_id',array('value' => $menu_id));?>
				
			<p><input type="checkbox" name="data[Menu][blank]" id="MenuBlank" value="1" /><?php __('link_window');?></p>
		</div>

		<input type="submit" value="<?php __('save');?>" class="input_button" />
		<!-- FIN CAMPOS FORMULARIO-->
	</form>

	<script type="text/javascript">
	//<![CDATA[
	Event.observe('f_register', 'submit', function(event){ajaxFormUpdater('f_register', 'tree-view', 'ajax_loading');}, false);
	//]]>
	</script>


